-
Notifications
You must be signed in to change notification settings - Fork 15k
[CIR] React to breaking change to DataLayoutTypeInterface #128772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIR] React to breaking change to DataLayoutTypeInterface #128772
Conversation
In llvm#128754, `DataLayoutTypeInterface` was changed to give `getPreferredAlignment` a default implemention. As a result, table-gen no longer declared `getPreferredAlignment` when defining a class that contained `[DeclareTypeInterfaceMethods<DataLayoutTypeInterface>]` in the table-gen definition. That means all of the definitions in `CIRTypes.cpp`, such as `PointerType::getPreferredAligment`, were compilation errors. Delete all the definitions of `getPreferredAlignment`. I verified that the default implementation does the exact same thing as the explicit overrides that are being deleted.
@llvm/pr-subscribers-clang Author: David Olsen (dkolsen-pgi) ChangesIn #128754, Delete all the definitions of Full diff: https://github.com/llvm/llvm-project/pull/128772.diff 1 Files Affected:
diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index f3349250f2205..d1b143efb955e 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -125,12 +125,6 @@ uint64_t IntType::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-IntType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
mlir::LogicalResult
IntType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
unsigned width, bool isSigned) {
@@ -163,12 +157,6 @@ SingleType::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-SingleType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &DoubleType::getFloatSemantics() const {
return llvm::APFloat::IEEEdouble();
}
@@ -185,12 +173,6 @@ DoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-DoubleType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &FP16Type::getFloatSemantics() const {
return llvm::APFloat::IEEEhalf();
}
@@ -206,12 +188,6 @@ uint64_t FP16Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-FP16Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &BF16Type::getFloatSemantics() const {
return llvm::APFloat::BFloat();
}
@@ -227,12 +203,6 @@ uint64_t BF16Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-BF16Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &FP80Type::getFloatSemantics() const {
return llvm::APFloat::x87DoubleExtended();
}
@@ -249,12 +219,6 @@ uint64_t FP80Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return 16;
}
-uint64_t
-FP80Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return 16;
-}
-
const llvm::fltSemantics &FP128Type::getFloatSemantics() const {
return llvm::APFloat::IEEEquad();
}
@@ -270,12 +234,6 @@ uint64_t FP128Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return 16;
}
-uint64_t
-FP128Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return 16;
-}
-
const llvm::fltSemantics &LongDoubleType::getFloatSemantics() const {
return mlir::cast<cir::CIRFPTypeInterface>(getUnderlying())
.getFloatSemantics();
@@ -295,13 +253,6 @@ LongDoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
.getABIAlignment(dataLayout, params);
}
-uint64_t LongDoubleType::getPreferredAlignment(
- const ::mlir::DataLayout &dataLayout,
- mlir::DataLayoutEntryListRef params) const {
- return mlir::cast<mlir::DataLayoutTypeInterface>(getUnderlying())
- .getPreferredAlignment(dataLayout, params);
-}
-
LogicalResult
LongDoubleType::verify(function_ref<InFlightDiagnostic()> emitError,
mlir::Type underlying) {
@@ -397,12 +348,6 @@ BoolType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
return 1;
}
-uint64_t
-BoolType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return 1;
-}
-
//===----------------------------------------------------------------------===//
// PointerType Definitions
//===----------------------------------------------------------------------===//
@@ -421,13 +366,6 @@ PointerType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
return 8;
}
-uint64_t PointerType::getPreferredAlignment(
- const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- // FIXME: improve this in face of address spaces
- return 8;
-}
-
mlir::LogicalResult
PointerType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type pointee) {
|
@llvm/pr-subscribers-clangir Author: David Olsen (dkolsen-pgi) ChangesIn #128754, Delete all the definitions of Full diff: https://github.com/llvm/llvm-project/pull/128772.diff 1 Files Affected:
diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index f3349250f2205..d1b143efb955e 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -125,12 +125,6 @@ uint64_t IntType::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-IntType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
mlir::LogicalResult
IntType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
unsigned width, bool isSigned) {
@@ -163,12 +157,6 @@ SingleType::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-SingleType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &DoubleType::getFloatSemantics() const {
return llvm::APFloat::IEEEdouble();
}
@@ -185,12 +173,6 @@ DoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-DoubleType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &FP16Type::getFloatSemantics() const {
return llvm::APFloat::IEEEhalf();
}
@@ -206,12 +188,6 @@ uint64_t FP16Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-FP16Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &BF16Type::getFloatSemantics() const {
return llvm::APFloat::BFloat();
}
@@ -227,12 +203,6 @@ uint64_t BF16Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return (uint64_t)(getWidth() / 8);
}
-uint64_t
-BF16Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return (uint64_t)(getWidth() / 8);
-}
-
const llvm::fltSemantics &FP80Type::getFloatSemantics() const {
return llvm::APFloat::x87DoubleExtended();
}
@@ -249,12 +219,6 @@ uint64_t FP80Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return 16;
}
-uint64_t
-FP80Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return 16;
-}
-
const llvm::fltSemantics &FP128Type::getFloatSemantics() const {
return llvm::APFloat::IEEEquad();
}
@@ -270,12 +234,6 @@ uint64_t FP128Type::getABIAlignment(const mlir::DataLayout &dataLayout,
return 16;
}
-uint64_t
-FP128Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return 16;
-}
-
const llvm::fltSemantics &LongDoubleType::getFloatSemantics() const {
return mlir::cast<cir::CIRFPTypeInterface>(getUnderlying())
.getFloatSemantics();
@@ -295,13 +253,6 @@ LongDoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
.getABIAlignment(dataLayout, params);
}
-uint64_t LongDoubleType::getPreferredAlignment(
- const ::mlir::DataLayout &dataLayout,
- mlir::DataLayoutEntryListRef params) const {
- return mlir::cast<mlir::DataLayoutTypeInterface>(getUnderlying())
- .getPreferredAlignment(dataLayout, params);
-}
-
LogicalResult
LongDoubleType::verify(function_ref<InFlightDiagnostic()> emitError,
mlir::Type underlying) {
@@ -397,12 +348,6 @@ BoolType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
return 1;
}
-uint64_t
-BoolType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- return 1;
-}
-
//===----------------------------------------------------------------------===//
// PointerType Definitions
//===----------------------------------------------------------------------===//
@@ -421,13 +366,6 @@ PointerType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
return 8;
}
-uint64_t PointerType::getPreferredAlignment(
- const ::mlir::DataLayout &dataLayout,
- ::mlir::DataLayoutEntryListRef params) const {
- // FIXME: improve this in face of address spaces
- return 8;
-}
-
mlir::LogicalResult
PointerType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
mlir::Type pointee) {
|
@bcardosolopes @lanza You will run into this same problem with the next incubator rebase. The fix should be the same, though there will be more |
I am merging this now because it fixes a build breakage. If I messed up, it is easy enough to undo. |
Nice, thanks for the heads up. |
…vm#128772)" This reverts commit ad94af9.
In #128754,
DataLayoutTypeInterface
was changed to givegetPreferredAlignment
a default implemention. As a result, table-gen no longer declaredgetPreferredAlignment
when defining a class that contained[DeclareTypeInterfaceMethods<DataLayoutTypeInterface>]
in the table-gen definition. That means all of the definitions inCIRTypes.cpp
, such asPointerType::getPreferredAligment
, were compilation errors.Delete all the definitions of
getPreferredAlignment
. I verified that the default implementation does the exact same thing as the explicit overrides that are being deleted.